#include <stdio.h>

#define O_WRONLY (1)
#define O_CREAT (1 << 1)
#define O_APPEND (1 << 2)
#define O_RDONLY (1 << 3)
#define O_TRUNC (1 << 4)

void func(int flags)
{
    if (flags & O_WRONLY)
        printf("O_WRONLY\n");
    if (flags & O_CREAT)
        printf("O_CREAT\n");
    if (flags & O_APPEND)
        printf("O_APPEND\n");
    if (flags & O_RDONLY) 
        printf("O_RDONLY\n");
    if (flags & O_TRUNC)
        printf("O_TRUNC\n");

    printf("\n");
}
int main()
{
    func(O_WRONLY);
    func(O_WRONLY | O_CREAT);
    func(O_WRONLY | O_CREAT | O_APPEND);
    func(O_WRONLY | O_CREAT | O_APPEND | O_RDONLY);
    func(O_WRONLY | O_CREAT | O_APPEND | O_RDONLY | O_TRUNC);

    return 0;
}